<?php
/**
 * Created by PhpStorm.
 * User: hang
 * Date: 2021/11/29
 * Time: 17:13
 */
//分别打印请求完整地址，用户IP，请求方法（GET还是POST）和URL参数
echo '无URL参数';
echo '<br/>';
//print_r($_SERVER);
echo '完整地址：'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
echo '<br/>';
echo '用户IP：'.$_SERVER['SERVER_ADDR'];
echo '<br/>';
echo '请求方法：'.$_SERVER['REQUEST_METHOD'];
echo '<br/>';
echo 'URL参数：';
print_r($_GET);
//Array
//(
//    [PATH] =&gt; C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\120\Tools\Binn\ManagementStudio\;C:\Program Files (x86)\Microsoft SQL Server\120\DTS\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Users\hang\AppData\Local\Microsoft\WindowsApps;C:\Users\hang\.dotnet\tools
//[SYSTEMROOT] =&gt; C:\Windows
//[COMSPEC] =&gt; C:\Windows\system32\cmd.exe
//[PATHEXT] =&gt; .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
//[WINDIR] =&gt; C:\Windows
//[PHPRC] =&gt; D:/phpstudy_pro/Extensions/php/php7.3.4nts
//[_FCGI_SHUTDOWN_EVENT_] =&gt; 8872
//    [SCRIPT_NAME] =&gt; /get(无URL参数).php
//[REQUEST_URI] =&gt; /get(%E6%97%A0URL%E5%8F%82%E6%95%B0).php
//[QUERY_STRING] =&gt;
//    [REQUEST_METHOD] =&gt; GET
//[SERVER_PROTOCOL] =&gt; HTTP/1.1
//    [GATEWAY_INTERFACE] =&gt; CGI/1.1
//    [REMOTE_PORT] =&gt; 51206
//    [SCRIPT_FILENAME] =&gt; D:/phpstudy_pro/WWW/www.20211129.com/get(无URL参数).php
//[SERVER_ADMIN] =&gt; admin@example.com
//[CONTEXT_DOCUMENT_ROOT] =&gt; D:/phpstudy_pro/WWW/www.20211129.com
//[CONTEXT_PREFIX] =&gt;
//    [REQUEST_SCHEME] =&gt; http
//[DOCUMENT_ROOT] =&gt; D:/phpstudy_pro/WWW/www.20211129.com
//[REMOTE_ADDR] =&gt; 127.0.0.1
//    [SERVER_PORT] =&gt; 80
//    [SERVER_ADDR] =&gt; 127.0.0.1
//    [SERVER_NAME] =&gt; www.20211129.com
//[SERVER_SOFTWARE] =&gt; Apache/2.4.39 (Win64) OpenSSL/1.1.1b mod_fcgid/2.3.9a mod_log_rotate/1.02
//    [SERVER_SIGNATURE] =&gt;
//    [SystemRoot] =&gt; C:\Windows
//[HTTP_ACCEPT_LANGUAGE] =&gt; zh-CN,zh;q=0.9
//    [HTTP_ACCEPT_ENCODING] =&gt; gzip, deflate
//[HTTP_ACCEPT] =&gt; text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
//    [HTTP_USER_AGENT] =&gt; Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36
//    [HTTP_UPGRADE_INSECURE_REQUESTS] =&gt; 1
//    [HTTP_CACHE_CONTROL] =&gt; max-age=0
//    [HTTP_CONNECTION] =&gt; close
//    [HTTP_HOST] =&gt; www.20211129.com
//    [FCGI_ROLE] =&gt; RESPONDER
//    [PHP_SELF] =&gt; /get(无URL参数).php
//    [REQUEST_TIME_FLOAT] =&gt; 1638177439.9982
//    [REQUEST_TIME] =&gt; 1638177439
//)
